package jgl.vajra.kingkong.part.vehicle.viewModel;

import java.util.Map;

import jgl.vajra.kingkong.part.vehicle.contract.EditAddressContract;
import jgl.vajra.kingkong.part.vehicle.model.EditAddressModel;
import jgl.vajra.kingkong.widget.mvvm.factory.CreateModel;
import jgl.vajra.kingkong.widget.retrofithelper.rxsubscriber.ProgressObserver;

@CreateModel(EditAddressModel.class)
public class EditAddressViewModel extends EditAddressContract.ViewModel{
    @Override
    public void addAddressData(Map<String, Object> map,String authorization) {
        mModel.addAddressData(map,authorization).subscribe(new ProgressObserver<String>(true,null) {
            @Override
            public void _onNext(String msg) {
                mView.returnAddAddress(msg);
            }

            @Override
            public void _onError(String errorMessage, int errorCode) {
                super._onError(errorMessage, errorCode);
            }
        });
    }
}
